package com.aspose.cells;

class zbto implements zaig {
   private zix b;
   private int c;
   private String d;
   private int e;
   private int f;
   private zbam g;
   boolean a = true;
   private boolean h = false;
   private int i = 0;
   private boolean j = false;
   private com.aspose.cells.b.a.b.zs k = com.aspose.cells.b.a.b.zs.a();
   private boolean l = false;

   zbto(zig var1, Object var2, int var3, int var4) {
      this.b = new zix(var1, var2, var3, var4);
      this.c = 0;
      this.d = "";
      this.b.c().a(0);
      this.e = 1;
      this.f = 1;
      this.b.g().a(0);
      this.g = new zbam();
   }

   zix e() {
      return this.b;
   }

   public zagc a() {
      return this.b;
   }

   public int f() {
      return this.c;
   }

   public void a(int var1) {
      this.c = var1;
      this.a = false;
   }

   public String b() {
      return this.d;
   }

   public void a(String var1) {
      this.d = var1;
   }

   public int g() {
      return this.e;
   }

   public void b(int var1) {
      this.e = var1;
   }

   public int h() {
      return this.f;
   }

   public void c(int var1) {
      this.f = var1;
   }

   public boolean i() {
      return this.h;
   }

   public void b(boolean var1) {
      this.h = var1;
   }

   public int j() {
      return this.i;
   }

   public void d(int var1) {
      this.i = var1;
   }

   public zahq d() {
      return this.g;
   }

   public boolean c() {
      return this.j;
   }

   public void a(boolean var1) {
      this.j = var1;
   }

   boolean k() {
      return this.g.getCount() > 0;
   }

   boolean l() {
      if (this.d == null) {
         return false;
      } else {
         return this.d.length() > 0;
      }
   }

   void m() throws Exception {
      if (this.l()) {
         if (this.b.b() instanceof zbp && this.b.a().B().E()) {
            return;
         }

         zn var1 = this.b.a().ap();
         int var2 = this.b.a().ap().j();
         if (this.b.a().i().c().i() && this.b.c().i() && var1.j() != 4) {
            var1.b(4);
         }

         this.b.z();
         com.aspose.cells.b.a.b.zq var3 = new com.aspose.cells.b.a.b.zq((float)this.b.a.c(), (float)this.b.a.d(), (float)this.b.a.e(), (float)this.b.a.f());
         if (this.f() != 0 && !this.i()) {
            int var4 = this.b.a.c() + this.b.a.e() / 2;
            int var5 = this.b.a.d() + this.b.a.f() / 2;
            var3 = new com.aspose.cells.b.a.b.zq((float)(-this.k.b() / 2), (float)(-this.k.c() / 2), (float)this.k.b(), (float)this.k.c());
            var1.b((float)var4, (float)var5);
            var1.a((float)(-this.f()));
         }

         this.b.c().a(var3);
         this.b.d().a(var3);
         if (!this.k()) {
            if (this.i()) {
               zbsq.a(var1, (com.aspose.cells.b.a.b.zq)var3, this.b(), 255, this.b.h(), this.b.j(), this.g(), this.h(), this.j());
            } else {
               zbsq.a(var1, (com.aspose.cells.b.a.b.zq)var3, this.b(), 0, this.b.h(), this.b.j(), this.g(), this.h(), this.j());
            }
         } else {
            zbai var6 = new zbai();
            var6.a(zbsq.a(this.g()));
            var6.b(zbsq.a(this.h()));
            zbaq var7 = new zbaq(var3, var6, this.d(), this.e().h());
            var7.b(var1);
         }

         if (this.f() != 0) {
            var1.d();
         }

         if (this.b.a().i().c().i() && this.b.c().i() && var1.j() != var2) {
            var1.b(var2);
         }
      }

   }

   com.aspose.cells.b.a.b.zs a(com.aspose.cells.b.a.b.zt var1) {
      com.aspose.cells.b.a.b.zs var2 = com.aspose.cells.b.a.b.zs.a();
      if (!this.k()) {
         if (this.i()) {
            var2 = zbsq.a(this.b.a().ap(), this.b(), 255, this.b.h(), (com.aspose.cells.b.a.b.zt)var1, this.g(), this.h());
            return var2;
         } else {
            if (this.f() == 90) {
               var1 = new com.aspose.cells.b.a.b.zt(var1.c(), var1.b());
            }

            var2 = zbsq.a(this.b.a().ap(), this.b(), 0, this.b.h(), (com.aspose.cells.b.a.b.zt)var1, this.g(), this.h());
            this.k = var2;
            double var11 = (double)this.c * 3.141592653589793D / 180.0D;
            int var12 = (int)((double)var2.b() * Math.abs(Math.cos(var11)) + (double)var2.c() * Math.abs(Math.sin(var11)) + 0.5D);
            int var13 = (int)((double)var2.b() * Math.abs(Math.sin(var11)) + (double)var2.c() * Math.abs(Math.cos(var11)) + 0.5D);
            return new com.aspose.cells.b.a.b.zs(var12, var13);
         }
      } else {
         zbai var3 = new zbai();
         var3.a(1);
         var3.b(1);
         com.aspose.cells.b.a.b.zq var4 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var1.b(), var1.c());
         zbaq var5 = new zbaq(var4, var3, this.d(), this.e().h());
         com.aspose.cells.b.a.b.zq var6 = var5.a(this.e().a().ap());
         var2 = new com.aspose.cells.b.a.b.zs((int)((double)var6.h() + 0.5D), (int)((double)var6.i() + 0.5D));
         this.k = var2;
         double var7 = (double)this.c * 3.141592653589793D / 180.0D;
         int var9 = (int)((double)var2.b() * Math.abs(Math.cos(var7)) + (double)var2.c() * Math.abs(Math.sin(var7)) + 0.5D);
         int var10 = (int)((double)var2.b() * Math.abs(Math.sin(var7)) + (double)var2.c() * Math.abs(Math.cos(var7)) + 0.5D);
         return new com.aspose.cells.b.a.b.zs(var9, var10);
      }
   }

   protected void finalize() throws Exception {
      this.c(false);
   }

   public void n() {
      this.c(true);
      com.aspose.cells.b.a.zg.a(this);
   }

   protected void c(boolean var1) {
      if (!this.l) {
         if (var1 && this.b != null) {
            this.b.H();
         }

         this.l = true;
      }

   }
}
